﻿<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt"%>

<fmt:setBundle basename="ApplicationMessage" />

<!DOCTYPE html>
<html lang="zh-CN">
<head>

  <%@ include file="/WEB-INF/include/meta.jsp"%>
  <%@ include file="/WEB-INF/include/css.jsp"%>

</head>

<body class="ihg-theme-draft">

  <%@ include file="/WEB-INF/include/header.jsp"%>
  <%@ include file="/WEB-INF/include/submenu.jsp"%>

  <div class="container-fluid ihg-container has-ihg-sidemenu">

    <div class="ihg-breadcrumb">
      <ol class="breadcrumb border-breadcrumb">
        <li class="active">Session Setting List</li>
      </ol>
    </div>

    <div class="ihg-content-layout">

      <table class="table table-striped ihg-table tab-pane" style="margin-top: 15px;">
        <thead>
          <tr>
            <th>NAME</th>
            <th>ASSESSOR</th>
            <th>DELEGATE</th>
            <th>DATE</th>
            <th>ADMINISTRATOR</th>
            <th>STATUS</th>
            <th class="text-center">OPT</th>
          </tr>
        </thead>
        <tbody>
          <c:forEach items="${sessions}" var="session">
            <tr>
                <td>${session.name}</td>
                <td>${session.assessorCount}</td>
                <td>${session.delegateCount}</td>
                <td><fmt:formatDate value="${session.startDate}" pattern="yyyy/MM/dd"/>&nbsp;~&nbsp;<fmt:formatDate value="${session.endDate}" pattern="yyyy/MM/dd"/></td>
                <td>
                  <p style="text-align:left;">Administrator: ${session.sessionHost.name}</p>
                  <p style="text-align:left;">Assessor Owner: ${session.assessorOwner.name}</p>
                  <p style="text-align:left;">Delegate Owner: ${session.delegateOwner.name}</p>
                </td>
                <td><span class="label label-default">NOT STARTED</span></td>
                <td class="text-center">
                  <a href="${ctx.host}/session-settings/${session.id}/start" data-target="#start" data-toggle="modal">Start</a>&nbsp;&nbsp;
                  <a href="${ctx.host}/session-settings/${session.id}/delete" data-target="#delete" data-toggle="modal">Delete</a>&nbsp;&nbsp; 
                  <a href="${ctx.host}/session-settings/${session.id}">View</a>
                </td>
            </tr>
         </c:forEach>
        </tbody>
        <tfoot>
          <tr>
            <td colspan="7" class="no-vertical-padding">
              <div class="pull-left">
                <jsp:include page="/WEB-INF/include/page.jsp">
                  <jsp:param name="url" value="session-settings"/>
                  <jsp:param name="queryString" value="${queryString}"/>
                </jsp:include>
              </div>
            </td>
          </tr>
        </tfoot>
      </table>
    </div>

  </div>

  <%@ include file="/WEB-INF/include/footer.jsp"%>
  <%@ include file="/WEB-INF/include/script.jsp"%>


  <d:resource root="${ctx.resource}/build" type="script" src="js/page/session/session-list.js" />
  <script type="text/javascript">
    require([ 'page/session/session-list' ], function(page) {
      page.init();
    })
  </script>
</body>

</html>
